package com.situ.mall.test;

public class TryCatchFinally {
	static int x = 1;
	static int y = 10;
	static int z = 100;

	public static void main(String[] args) {
		int value = finallyReturn();
		System.out.println("value=" + value);// 101

		System.out.println("x=" + x);// 2
		System.out.println("y=" + y);// 10
		System.out.println("z=" + z);// 101
	}

	private static int finallyReturn() {
		try {
			// ...
			return ++x;
		} catch (Exception e) {
			return ++y;
		} finally {
			return ++z;
		}
	}
}
